<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>电子文档系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
	<script type="text/javascript" src="view/jquery/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="view/bootstrap/js/bootstrap.js"></script>
	<link rel="stylesheet" href="view/bootstrap/css/bootstrap.css">
	<link rel="stylesheet" href="view/css/docMan.css">
	<link rel="stylesheet" href="view/toastr/toastr.css">
	<script type="text/javascript" src="view/js/docMan.js"></script>
	<script type="text/javascript" src="view/toastr/toastr.min.js"></script>
	<script type="text/javascript" src="view/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="view/datapicker/laydate.js"></script>
	<link rel="stylesheet" href="view/css/searchInput.css">
	<link rel="stylesheet" href="view/datapicker/need/laydate.css">
<link rel="stylesheet" href="view/datapicker/skins/molv/laydate.css">
  </head>
  <body style="background: #ffffff;">
  	<div id="main-container" class="container" style="height: 100%;width:100%;background: #ffffff">
  		<div class="row" style="height: 100%">
  			<div  class="col-sm-12" style="height: 100%;padding:0px 30px;">
  				<div class="row mt_10" style="height:100%;width: 100%">
  					<form id="searchForm" action="zywjSearchNoLogin.action" method="post" onkeydown="if(event.keyCode==13){return false;}" >
  						<div class="jq22-search-form" style="margin-left:22%;">
					        <div id="search-bd" class="search-bd">
					            <ul>
					                <li value="0" class="selected">标题</li>
					            </ul>
					        </div>
					        <div id="search-hd" class="search-hd">
					            <div class="search-bg"></div>
					            <input type="hidden" id="searchType" value="1" name="pageDangan.searchType" >
					            <input type="text" id="s2" class="search-input" name="pageDangan.searchText" value='<s:property value="pageDangan.searchText" />' style="display: inline-block;padding: 17px 5px;">
					            <span class="s1 pholder" style="display: none;"></span>
					            <span class="s2 pholder" style="display: none;"></span>
					            <span class="s3 pholder" style="display: none;"></span>
					            <button id="btn_search" class="btn-search" value="搜索"style="font-size:14px;font-family:'Microsoft YaHei';">搜索</button>
					        </div>
					    </div>
						<div class="row" style="margin-top: 10px;margin-left:25%;">
							<input  type="hidden" id="inputlwdw" name="pageDangan.islwdwSearch" value="true"  >
							<!--1表示来自OA，可参见FinalConfig.java  -->
							<input  type="hidden" id="lwdwStr" name="pageDangan.lwdw" value="false"  >
							<input  type="hidden"  name="pageDangan.everyPage" value="15"  >
							<input type="hidden" name="pageDangan.orderByTime" value="true">
							<div class="col-md-10" id="div_lwdw" style="">
								<s:if test="pageDangan.lwdw=='国土资源部'">
									<div class=" lwdw_selected lwdw"  name="国土资源部"><label for="bj">国土资源部</label></div>
								</s:if><s:else>
									<div class="lwdw_unselected lwdw"  name="国土资源部"><label for="bj">国土资源部</label></div>
								</s:else>
								<s:if test="pageDangan.lwdw=='省国土资源厅'">
									<div  class="lwdw_selected lwdw" name="省国土资源厅"><label for="sj">省国土资源厅</label></div>
								</s:if><s:else>
									<div  class="lwdw_unselected lwdw" name="省国土资源厅"><label for="sj">省国土资源厅</label></div>
								</s:else> 
								<s:if test="pageDangan.lwdw=='宁波市政府集合'">
									<div  class="lwdw_selected lwdw" name="宁波市人民政府"><label for="nbszf">市政府</label></div>
								</s:if><s:else>
									<div  class="lwdw_unselected lwdw" name="宁波市人民政府"><label for="nbszf">市政府</label></div>
								</s:else>
								<s:if test="pageDangan.lwdw=='宁波市国土资源局'">
									<div  class="lwdw_selected lwdw" name="宁波市国土资源局"><label for="sj">市国土资源局</label></div>
								</s:if><s:else>
									<div  class="lwdw_unselected lwdw" name="宁波市国土资源局"><label for="sj">市国土资源局</label></div>
								</s:else>
								<s:if test="pageDangan.lwdw=='其他'">
									<div class="lwdw_selected lwdw" id="qt" name="其他"><label for="qt">其他</label></div>
									<input  type="hidden" id="lwdwb" name="pageDangan.lwdwb" value="0" style="margin-right:10px;">
									<select class="form-control" id="qtlwdw" 
									style="width:150px;margin:5px;height:35px;font-size:13px;">
									<option value="其他" <s:if test="pageDangan.lwdw=='其他'">selected="selected"</s:if>>其他</option>
									<option value="市级机关" <s:if test="pageDangan.lwdw=='市级机关'">selected="selected"</s:if>>市级机关</option>
									<option value="宁波市人民政府" <s:if test="pageDangan.lwdw=='宁波市人民政府'">selected="selected"</s:if>>宁波市人民政府</option>
									<option value="市委" <s:if test="pageDangan.lwdw=='市委'">selected="selected"</s:if>>市委</option>
									<option value="县区级来文件" <s:if test="pageDangan.lwdw=='县区级来文件'">selected="selected"</s:if>>县区级来文件</option>
									<option value="市政府承办单" <s:if test="pageDangan.lwdw=='市政府承办单'">selected="selected"</s:if>>市政府承办单</option>
									<option value="省政府" <s:if test="pageDangan.lwdw=='省政府'">selected="selected"</s:if>>省政府</option>
									<option value="中央、中央办公厅" <s:if test="pageDangan.lwdw=='中央、中央办公厅'">selected="selected"</s:if>>中央、中央办公厅</option>
									<option value="省委" <s:if test="pageDangan.lwdw=='省委'">selected="selected"</s:if>>省委</option>
									<option value="宁波市发展和改革委员会" <s:if test="pageDangan.lwdw=='宁波市发展和改革委员会'">selected="selected"</s:if>>宁波市发展和改革委员会</option>
									<option value="国务院" <s:if test="pageDangan.lwdw=='国务院'">selected="selected"</s:if>>国务院</option>
								</select>
								</s:if><s:else>
									<div class="lwdw_unselected lwdw" id="qt" name="其他"><label for="qt">其他</label></div>
									<input  type="hidden" id="lwdwb" name="pageDangan.lwdwb" value="0" style="margin-right:10px;">
									<select class="form-control" id="qtlwdw" 
									style="width:150px;display:none;;margin:5px;height:35px;font-size:13px;">
									<option value="其他" selected="selected">其他</option>
									<option value="市级机关" >市级机关</option>
									<option value="宁波市人民政府" >宁波市人民政府</option>
									<option value="市委" >市委</option>
									<option value="县区级来文件" >县区级来文件</option>
									<option value="市政府承办单" >市政府承办单</option>
									<option value="省政府" >省政府</option>
									<option value="中央、中央办公厅" >中央、中央办公厅</option>
									<option value="省委" >省委</option>
									<option value="宁波市发展和改革委员会" >宁波市发展和改革委员会</option>
									<option value="国务院" >国务院</option>
								</select>
								</s:else>  
							</div>
						</div>
  						<div class="row file_list mt_20">
  							<table class="table table-striped ">
  								<thead>
  									<tr style="width:100%;">
  										<th style="width:11%;">时间</th>
  										<th style="width:10%">来文单位</th>
  										<th style="width:10%;">来文编号</th>
  										<th style="width:40%;">标题</th>
  										<th style="width:7%;">操作</th>
  									</tr>
  								</thead>
  								<tbody>
  								</tbody>
  							</table>
		  				</div>
		  				<input type="hidden" id="isPage" name="pageDangan.isPage" value='false' >
		  				<!--分页按钮  -->
		  				<div class="row" style="margin-top: 20px;margin-bottom: 20px;">
  							<button class="btn btn-link prePage" <s:if test='pageDangan.hasPrePage==false' >disabled="disabled"</s:if> >上一页</button>
  							<input type="number" id="pageIndex" value='<s:property value="pageDangan.currentPage" />' style="width:80px;display: inline;" class="form-control">
  							<input type="number" id="currentPage" name="pageDangan.currentPage" value='<s:property value="pageDangan.currentPage"/>' style="display: none;">
  							<input id="totalPage" value='<s:property value="pageDangan.totalPageCount" />' style="display: none;">
  							<button class="btn btn-link nextPage" type="button" <s:if test='pageDangan.hasNextPage==false' >disabled="disabled"</s:if>>下一页</button>
  							共<span class="pageCount" ><s:property value="pageDangan.totalPageCount"/> </span>页，<s:property value="pageDangan.totalCount"/>条记录
  						</div>
  					</form>
  				</div>
  				
  				<div id="pdfModal" class="col-md-12 "
						style="z-index: 10000;position: absolute;min-height:700px;display: none;top:50px;">
						<div class="modal-header" style="background: t;">
							<button type="button" class="close" data-dismiss="modal">
								<span aria-hidden="true" id="closePdf" class="bold">×</span><span
									class="sr-only">关闭</span>
							</button>
							<h4 id="fileName" class="modal-title center bold"></h4>
						</div>
						<iframe id="pdf" name="pdf" contextmenu="return false"
							scrolling="yes" src="" style="width:98%; ">
						</iframe>
				</div>
  			</div>
  		</div>
  	</div>
  	<!--文件收藏的modal	  -->
  	<div class="modal fade" id="collectFileModal" tabindex="-1"
		role="dialog" aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="exampleModalLabel">文件收藏</h4>
				</div>
				<div class="modal-body">
					<span class="">请选择目标文件夹</span>
					<div class="row myDir_lists linktreeWrap margine_clear mt_10">
						<ul class="disk-copy-ul unstyled">
							<li><a href="javascript:void(0);" class="myFirstDir"
								id="${personalDirId}"> <i
									class="diskpic-copy-right mgtDiskListArrows"></i>
							</a> <span class="ch mgtActive"><i class="diskpic-smallbox"></i><span
									class="me-margin-left5">我的网盘</span></span></li>
						</ul>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" id="btn_collect" class="btn btn-primary">确定</button>
					<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	
</body>
  <script type="text/javascript">
  var height=getWindowHieght()*0.9;
  var width=getWindowWidth()*0.6;
  $("#pdfModal").css("height",height);
  $("#pdfModal").css("width",width);
  $("#pdf").css("height",height);
  $("#pdf").css("width",width*0.98);
 	 laydate.skin('molv');
		laydate({elem:'#startDate'});
		laydate({elem:'#endDate'});
  $(function(){
  	$("#closePdf").on("click",function(){
  		$("#pdfModal").toggle(400);
  	});
  	$(".btn_look_pdf").on("click",function(){
  		var id=$(this).attr("id");
  		var url="/DocMan/dowloadFileNologin.action?indexFrom=1&id="+id;
  		$("#pdf").attr("src",url);
  		$("#pdfModal").toggle(400);
  	});
  	$(".prePage").on("click",function(){
  		var pageCount=Number($("#currentPage").val())-1;
  		$("#currentPage").val(pageCount);
  		console.info($("#currentPage").val());
  		lwdw();
  		$("#isPage").val("true");
  		$("#searchForm").submit();
  	});
  	$("#btn_search").on("click",function(){
			lwdw();
			$("#isPage").val("false");
			$("#searchForm").submit();
	});
  	$(".nextPage").on("click",function(){
  		var pageCount=Number($("#currentPage").val())+1;
  		$("#currentPage").val(pageCount);
  		console.info($("#currentPage").val());
  		lwdw();
  		$("#isPage").val("true");
  		//window.location="http://localhost:8080/DocMan/pageSearch.action?currentPage="pageCount;
  		$("#searchForm").submit();
  	});
  	
  	$("#pageIndex").on("keyup",function(event){
  		if(event.keyCode=="13"){
  			var currentPage=Math.floor(Number($("#pageIndex").val()));
  			var totalPage=Number($("#totalPage").val());
  			if(currentPage<=0){
  				toast.error("请选择跳转的页数,或正确的页数", "温馨提示");
  			}
  			if(currentPage>totalPage){
  				toast.error("跳转页数不能大于总页数", "温馨提示");
  			}
  			$("#currentPage").val(currentPage);
  			$("#searchForm").submit();
  		}
  	});
  });
  $(".lwdw").on("click",function(){
		var lwdw=$(this).attr("name");
		if(lwdw!="其他"){
			var lwdw="";
			lwdw=$(this).attr("name");
			if(lwdw=="其他"){
				lwdw=$("#qtlwdw").val();
			}
			$("#lwdwStr").val(lwdw);
			if(lwdw=="宁波市政府集合"){
				$("#mutilLwdw").val("true");
			}else{
				$("#mutilLwdw").val("false");
			}
			console.info(lwdw);
			$("#isPage").val("false");
			$("#searchForm").submit();
		}else{
			
		}
	});
	$("#qtlwdw").change(function(){
		var lwdw=$("#qtlwdw").val();
		console.info(lwdw);
		$("#lwdwStr").val(lwdw);
		$("#isPage").val("false");
		$("#searchForm").submit();
	})
	
function lwdw(){
			var lwdw="";
			lwdw=$(".lwdw_selected").attr("name");
			if(lwdw=="其他"){
				lwdw=$("#qtlwdw").val();
			}
			if(lwdw=="宁波市政府集合"){
				$("#mutilLwdw").val("true");
			}else{
				$("#mutilLwdw").val("false");
			}
			$("#lwdwStr").val(lwdw);
			console.info(lwdw);
}
  </script>
</html>
